package com.zhangheng.arktspage.data

import java.time.LocalDateTime

val uiCode = "/*\n" +
        " * Copyright (c) ${LocalDateTime.now().year} Shanghai Dongzheng Automotive Finance Co.,Ltd. \n" +
        " * Developer: zhangh\n" +
        " * Updated: ${LocalDateTime.now().monthValue}月${LocalDateTime.now().dayOfMonth}日 ${LocalDateTime.now().hour}:${LocalDateTime.now().minute}\n" +
        " * Des:\n" +
        " */\n" +
        "\n" +
        "import { CommonFun, DzCard, DzNavigationBar, EventBus, DzDialogSync, DzLoading, DzRouter } from '@dz-frontend/common'\n" +
        "import API from '../../api/Index'\n" +
        "import { IndexAction, PageData } from './IndexVM'\n" +
        "\n" +
        "const isNull = CommonFun.Common.isNull\n" +
        "const isNull_0 = CommonFun.Common.isNull_0\n" +
        "const showToast = CommonFun.CommonCheck.showToast\n" +
        "\n" +
        "@ComponentV2\n" +
        "export struct Index {\n" +
        "  @Local text: string = '组件内参数。'\n" +
        "  pageData: PageData = new PageData()\n" +
        "  private indexAction = new IndexAction(this.pageData)\n" +
        "\n" +
        "  aboutToAppear() {\n" +
        "    this.indexAction.requestPageData()\n" +
        "  }\n" +
        "\n" +
        "  build() {\n" +
        "    Column() {\n" +
        "      Text(this.text).onClick(() => {\n" +
        "        this.text = '值已更新'\n" +
        "      })\n" +
        "      Text('@ObservedV2的参数更新：' + this.pageData.value1).onClick(() => {\n" +
        "        this.indexAction.setData()\n" +
        "      }).margin({ top: 20 })\n" +
        "    }.alignItems(HorizontalAlign.Start)\n" +
        "    .padding({ top: 20 })\n" +
        "  }\n" +
        "}"

val vmCode = "/*\n" +
        " * Copyright (c) ${LocalDateTime.now().year} Shanghai Dongzheng Automotive Finance Co.,Ltd. \n" +
        " * Developer: zhangh\n" +
        " * Updated: ${LocalDateTime.now().monthValue}月${LocalDateTime.now().dayOfMonth}日 ${LocalDateTime.now().hour}:${LocalDateTime.now().minute}\n" +
        " * Des:\n" +
        " */\n" +
        "\n" +
        "import { Logger, CommonFun, DzLoading, DzDialogSync, DzRouter } from '@dz-frontend/common'\n" +
        "import API from '../../api/Index'\n" +
        "\n" +
        "const isNull = CommonFun.Common.isNull\n" +
        "const arrayNull = CommonFun.Common.arrayNull\n" +
        "const objIsNull = CommonFun.Common.objIsNull\n" +
        "const isNull_0 = CommonFun.Common.isNull_0\n" +
        "const showToast = CommonFun.CommonCheck.showToast\n" +
        "const getRouteParams = CommonFun.Utils.getRouteParams\n" +
        "\n" +
        "@ObservedV2\n" +
        "export class PageData {\n" +
        "  @Trace value1: string = '这是初始化'\n" +
        "}\n" +
        "\n" +
        "export class IndexAction{\n" +
        "  private pageData:PageData\n" +
        "\n" +
        "  constructor(pageData:PageData) {\n" +
        "    this.pageData = pageData\n" +
        "  }\n" +
        "\n" +
        "  // 获取页面数据\n" +
        "  requestPageData = () => {\n" +
        "    // API.orderDetail.getIdNoMobile(idNoValue + '').then((res) => {})\n" +
        "  }\n" +
        "\n" +
        "\n" +
        "  setData() {\n" +
        "    this.pageData.value1 = '这个值已更新'\n" +
        "  }\n" +
        "}"